package com.itheima.reggie.mapper;

import com.itheima.reggie.entity.DishFlavor;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface DishFlavorMapper {


    Integer save(@Param("dishFlavorList") List<DishFlavor> dishFlavorList);

    @Delete("delete from dish_flavor where dish_id=#{id}")
    Integer deleteById(Long id);

    Integer delete(@Param("ids") Long[] ids);

    @Select("select * from dish_flavor "+
            "where dish_id=#{dishId} and is_deleted=0"
   )
    List<DishFlavor> findByDishId(Long dishId);
}
